import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop028-删除标签组流程"

str1="华为老大"

# 1.点击“删除”按钮，确定删除，删除成功。
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"商品管理","商品标签","商品标签分组")
# 点击删除按钮
firefox.find_element_by_xpath("//td[text()='%s']/following-sibling::td[4]/a[2]"%str1).click()
firefox.switch_to_alert().accept()
time.sleep(2)
# 断言
try:
    firefox.find_element_by_xpath("//td[text()='%s']"% str1).is_displayed()
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()